-- Cambio de nombre al campo elegido que se usa en Java pero produce conflictos en gestión

ALTER TABLE public.ctem
    DROP COLUMN elegido;
    
ALTER TABLE public.ctem
    ADD COLUMN elegidoJava character varying(1) COLLATE pg_catalog."default" default 'N';

ALTER TABLE CTEM
DISABLE TRIGGER ALL;

UPDATE public.ctem SET elegidoJava = 'N';    

ALTER TABLE CTEM
ENABLE TRIGGER ALL;

ALTER TABLE public.ctem
    ALTER COLUMN elegidoJava SET NOT NULL;

ALTER TABLE public.cteextm
    DROP COLUMN elegido;
    
ALTER TABLE public.cteextm
    ADD COLUMN elegidoJava character varying(1) COLLATE pg_catalog."default" default 'N';

ALTER TABLE cteextm
DISABLE TRIGGER ALL;

UPDATE public.cteextm SET elegidoJava = 'N';    

ALTER TABLE cteextm
ENABLE TRIGGER ALL;

ALTER TABLE public.cteextm
    ALTER COLUMN elegidoJava SET NOT NULL;

    
-- ==================================
SELECT aaVersion('475.00', '474.00');
-- ==================================
